#!/bin/bash 
set -e;    

BUMPSLIDE_LIB=/Users/tkdave/work/bumpslide_lib  

cd $BUMPSLIDE_LIB;     

#scripts/build_docs.sh   

mkdir tmp
cp -R classes tmp
cp -R docs tmp
cp -R examples tmp 
cp LICENSE.txt tmp
cd tmp/
find . -name .svn | xargs rm -rf          
rm -rf classes/pdf417lib
cd ..

BUILDNAME=bumpslide_as3_`date +%Y%m%d`   
mv tmp $BUILDNAME   
zip -q -r $BUILDNAME.zip $BUILDNAME
rm -rf $BUILDNAME        
mv $BUILDNAME.zip builds/
           

# update app template
APPTMP=apptemp

mkdir $APPTMP;

# copy app_template
cp -R $BUMPSLIDE_LIB/examples/app_template/  $APPTMP   
#cp -R $BUMPSLIDE_LIB/classes/caurina $APPTMP/src/classes
cp -R $BUMPSLIDE_LIB/classes/fl $APPTMP/src/classes
cp -R $BUMPSLIDE_LIB/classes/com/bumpslide $APPTMP/src/classes/com

find $APPTMP -name .svn | xargs rm -rf

APP_BUILDNAME=bumpslide_apptemplate_orig_`date +%Y%m%d`   
mv $APPTMP $APP_BUILDNAME   
zip -q -r $APP_BUILDNAME.zip $APP_BUILDNAME
rm -rf $APP_BUILDNAME        
mv $APP_BUILDNAME.zip builds/      

           
# update mvc app template
APPTMP2=apptemp2

mkdir $APPTMP2;

# copy app_template
cp -R $BUMPSLIDE_LIB/examples/app_template_mvc/  $APPTMP2   
cp -R $BUMPSLIDE_LIB/classes/fl $APPTMP2/src/classes
cp -R $BUMPSLIDE_LIB/classes/com/bumpslide $APPTMP2/src/classes/com

find $APPTMP2 -name .svn | xargs rm -rf

APP_BUILDNAME2=bumpslide_apptemplate_mvc_`date +%Y%m%d`   
mv $APPTMP2 $APP_BUILDNAME2   
zip -q -r $APP_BUILDNAME2.zip $APP_BUILDNAME2
rm -rf $APP_BUILDNAME2        
mv $APP_BUILDNAME2.zip builds/


